<?php
namespace Admin\Controller;

use Think\Controller;

class CommonController extends Controller
{

    public function control()
    {
        $this->_name = CONTROLLER_NAME;
        if (! session('uid')||!session('username')) {
            redirect(U('Index/index'), 2, '超时退出，请重新登陆');
        }
        $map['role'] = session('depname');
        $list = M('Group')->join('crm_group_url on crm_group.id = crm_group_url.group_id')
            ->join('crm_url on crm_group_url.url_id = crm_url.id')
            ->where($map)
            ->field('url')
            ->select();
        $data['url'] = $_SERVER["PATH_INFO"];
        if(in_array($data , $list)){
            $this->error('功能您不能操作');
        }
        //return $list;
    }
}